Brent crude oil settled higher on Thursday, reversing an earlier decline after U.S. data showed stronger-than-expected retail sales and a fall in jobless claims, although subdued global energy demand limited oil's rebound.
U.S. retail sales increased 0.6 percent in May after edging up 0.1 percent in April. A separate report showed the number of Americans filing new claims for jobless benefits fell last week, nearing its lowest level in five years.
U.S. stocks edged higher, with the Dow back above 15,000, as the data encouraged investors that the economy may be shaking off a recent soft patch.
Brent crude, a benchmark for many international oil varieties, was up 76 cents to end at $104.25 a barrel on the ICE Futures exchange in London.
Benchmark oil for July delivery gained 81 cents to close at $96.69 a barrel on the New York Mercantile Exchange.
"The data put a bid back in the equity market and oil prices are following it, but it doesn't seem as though we've really caught a strong bid because the market is being held back by weak underlying fundamentals," said Gene McGillian, oil analyst at Tradition Energy in Stamford, Connecticut.
"Until we get back to either side of the band, we're still going to be driven by headline trading," he said, referring to the $5-$6 ranges within which both crudes have been trading over the last five weeks.
Global stock markets fell for a third day on Thursday and the U.S. dollar hit a 10-week low against the yen as investors unwound bets linked to central bank stimulus measures that have buoyed many asset markets.
European shares fell as much as 1.1 percent before recovering slightly, while Japan's Nikkei fell 6.4 percent, its second-biggest daily drop in more than two years.
That rattled markets and left Asian shares at their lowest level of the year.
Earlier, the dollar declined 1.8 percent against the yen as investors spooked by Japan's stock market retreat unwound bets the yen would weaken.
"All of this has made the market extremely volatile, and I think the volatility is going to stay here while the market continues rolling back down," said Mark Waggoner, president of Excel Futures in Bend, Oregon.
Earlier, oil fell on reports indicating weak demand, including a lowered forecast for global economic growth this year by the World Bank.
"The demand picture is still very subdued at the moment," said Carsten Fritsch, analyst at Commerzbank.
On Wednesday, the International Energy Agency said modest economic growth was limiting oil demand worldwide, and some developed economies would see absolute declines in oil consumption in 2013.
Oil prices drew support from disruption to flows, although McGillian pointed out that with current stockpiles of oil, the market could "take a wait and see approach."
Libya is struggling to hold output stable, while supply of North Sea crude, which underpins Brent, is expected to drop more sharply than usual due to maintenance this summer.
Sudan said rebels based in South Sudan had attacked a pipeline in its Diffra oil field on Wednesday, causing an explosion and fire that lasted for several hours. An Army spokesman said the pipeline was being restored.
Kinder Morgan Energy Partners LP said Thursday shut its 307,000 barrel per day Trans Mountain pipeline, which runs between Edmonton, Alberta and the port of Vancouver and Puget Sound, after a spill of around 12 barrels of oil was detected during routine maintenance work.