Oil eked out its first gain in three weeks as half of oil production in the U.S. Gulf of Mexico was offline from an approaching storm.

Gains were capped as the budget standoff in the United States continued and uncertainty about when it would end gripped the market. Meanwhile, in the latest political wrangling, U.S. House of Representatives Democrats worked on a manoeuvre that would force a vote on legislation to fully reopen the federal government immediately.

Oil and gas firms shut in platforms and evacuated some workers stationed offshore in the U.S. Gulf of Mexico on Friday, as Tropical Storm Karen moved through the basin, which is responsible for about one-fifth of total U.S. oil output.

U.S. oil ended the day 53 cents higher at $103.84 a barrel after trading as high as $104.19. The front-month contract ended the week with a 0.94 percent gain.

Brent crude oil ended 46 cents higher at $109.46 a barrel, after trading as high as $109.77. Brent ended the week less than one percent higher, following three weeks of losses.

Still analysts ruminated over how much impact the storm would have as U.S. onshore oil production grows and as the storm may quickly pass.

"The Gulf output is still material, but any shut-ins will be quickly reversed and the output will not be missed," said John Kilduff, partner at Again Capital LLC in New York.

Analysts were in agreement about how the continued budget showdown in Congress would hurt oil demand as it stifled economic growth.

"The hit to economic activity from the government shutdown is also offsetting some the angst that Karen would otherwise generate," Kilduff said.

BUDGET WRANGLING

As the shutdown entered its fourth day - with nearly 1 million government workers at home without pay - some federal agencies and programs stopped functioning, cutting into the release of key economic data.

Global leaders and analysts were concerned the shutdown would hurt economic growth and limit oil demand in the world's largest oil consumer.

Oil pared gains sharply earlier in the session after U.S. House of Representatives Speaker John Boehner said the House will not vote on a spending bill to end the government shutdown if it did not have conditions. He also demanded spending cuts in exchange for raising the government's debt ceiling.

The comments suggested the political stalemate in Washington would continue.

Also, the United States faced the possibility of defaulting on its financial obligations on Oct. 17 as the opposing political parties remained locked in debate over whether to raise the debt ceiling.

The dispute over U.S. government spending has weighed on financial markets and sapped the dollar, which was off an eight-month low of 79.627 on Friday against a basket of major currencies. It was last trading at 80.101.

A weaker dollar is supportive for oil, as importing nations find it cheaper to buy dollar-priced oil in their own currencies. 

(By Jeanine Prezioso; Additional reporting by Robert Gibbons in New York, Alexander Winning in London and Jacob Gronholt-Pedersen in Singapore; Editing by Jason Neely, James Jukwey, Jeffrey Benkoe, Andrew Hay and Peter Galloway)