Oil posts first positive week in three, gains over 4%

A worker stands next to a pump jack at an oil field Sergeyevskoye owned by Bashneft company north from Ufa, Bashkortostan, Russia.
Sergei Karpukhin | Reuters

Oil prices closed higher on Friday after the U.S. oil rig count fell for a ninth straight week, indicating crude production could decline in coming months, which might help reduce the global supply glut.

Prices got another boost from separate data showing U.S. oil output in August fell to third lowest figure this year.

Read More Chevron slashes 2016 budget to weather low oil prices

In the latest session, Brent crude was up $1.05 at $49.85 a barrel. U.S. crude closed up 56 cents at $46.59 a barrel, posting its first positive weekly gain in three.

Both benchmarks were headed for their first weekly gain in three, helped largely by Wednesday's 6 percent rally, driven by a smaller-than-anticipated build in U.S. crude and sharper-than-expected falls in gasoline and diesel stockpiles.

U.S. oil drillers removed 16 rigs in the week ended Oct. 30, bringing the total rig count down to 578, the least since June 2010, oil services company Baker Hughes Inc said in its closely followed report.

'Incredibly bearish' oil trends backing off: Oil expert

The drop was a sign that low prices were continuing to keep drillers away from the well pad, signaling lower production over the next several months.

But while U.S. output is declining, global supplies of crude and refined oil products continue to grow, testing storage capacity and hammering oil company results.

This is prompting oil bears to argue that price rallies, such as Wednesday's, cannot be sustained.

"Looking at the bigger picture, there is still lots of oil in the United States," PVM Oil Associates analyst Tamas Varga said. "We should see a softer market in the coming days."

Read MoreMega 'midstream' deals drive oil and gas M&A: PwC

Others are not so sure.

"Although providing fundamental rationale for a 6 percent single day advance remains challenging, we are conceding to a significant improvement in the short term chart picture and a need to lift pricing in order to attract fresh selling," said Jim Ritterbusch of Ritterbusch & Associates, an oil consultancy in Chicago.

A Reuters survey was supportive to the market, showing that Saudi Arabia and Iraq pumped less oil in October than African nations in OPEC, pushing the producer group's output down from near record highs.

Chinese government data also showed the country was doubling crude oil import quotas for 2016.

Read MoreU.S. to Deploy Special Operations Forces in Syria: Official

The U.S. will deploy a small number of special operations forces to Syria to serve in an advisory role, NBC News reported on Friday. The troops would be stationed in northern Syria and work with groups with a proven track record of fighting ISIS, an official told NBC News.

Markets largely shrugged off the news, said John Kilduff, founding partner at Again Capital.

"We've been hearing rumors of this for some time," Kilduff told CNBC. "It doesn't sound like a game-changer to me."

However, conflict escalation in Syria could eventually weigh on oil prices, Roberto Friedlander, head of equity trading and sales training at Brean Capital said.

"The key risk is to the infrastructure in Syria," he said. "There are a number of pipelines that crisscross Syria and go all the way from Saudi Arabia up north into Turkey [and] through Syria and Iraq."

"The key is that, if any of these ... pipelines are hit by any of the multiple parties that are in the area ... there's a real geopolitical risk," he said.

—CNBC's Tom DiChristopher contributed to this story.