Brent crude gained more than $1 on Tuesday as U.S. consumer optimism and signs of easier monetary policy from central banks pushed stock markets higher, while increasing Middle East tension also supported oil.
Brent crude oil posted its biggest one-day rise since early May, settling up more than 1.5 percent.
U.S. stocks rallied after central banks reassured investors that they will keep policies designed to foster global growth, with the Dow closing at another record high level this year.
The Conference Board's U.S. consumer confidence index rose in May to its highest level since February 2008, suggesting demand for oil could rise as the economy shows signs of improvement.
Brent for July gained as much as $2 a barrel, and settled up $1.61 at $104.23 per barrel, a rise of 1.57 percent. U.S. crude rose 86 cents to settle at $95.01 per barrel.
"The consumer confidence number was a big factor here, and the overall strength of the equity markets added to the tenor of demand outlook, which should be picking up," said John Kilduff, partner at Again Capital LLC in New York.
Kilduff said the confidence numbers and equity markets formed a "positive feedback loop", with the wealth effect from strong equity markets making consumers more optimistic.
The price climb comes ahead of Friday's meeting of the Organization of the Petroleum Exporting Countries, at which OPEC will decide its production policy.
Oil trading has been choppy in May. Consecutive up days have alternated with streaks of down days, keeping Brent and U.S. crude largely within ranges of $6 and $7 respectively.
Brent is down more than 12 percent from its year high in February of over $119, while U.S. crude has lost nearly 3 percent from its January high above $98.
"Every time we go up toward year highs, the market seems to back off of it," said Gene McGillian, analyst at Tradition Energy in Stamford, Connecticut.
"We're still in that pattern, where we're being pushed back and forth on headlines," he said.
On Tuesday, buoyant investor sentiment overcame pressure on oil prices from a stronger dollar and worries about ample oil supplies.
Analysts also cited a geopolitical risk premium in oil prices stemming from worries that the escalating war in Syria might spark more strife in the Middle East, which accounts for almost a fifth of the world's sea-borne crude oil supplies.
Attempts to renew a European arms embargo on Syria failed on Monday and Britain and France are likely to start supplying Syrian rebels with weaponry later this year.
"[News from Syria] could potentially be lending some strength to Brent, and hence Brent is up relative to U.S. crude," said Stephen Schork, editor of The Schork Report in Villanova, Pennsylvania.
The stock market rally took the focus away from oil market supply-and-demand fundamentals, which have looked fairly gloomy in recent weeks.
Jim Ritterbusch, president of Ritterbusch and Associates in Galena, Illinois, wrote in a research note that bullish guidance from the equity markets was hard to square with flat projections of gasoline demand from the U.S. Energy Information Administration.
"We are still having difficulty connecting the dots between this type of favorable guidance and any significant improvement in U.S. petroleum demand," Ritterbusch wrote, noting that central bank liquidity was the "larger driver of both oil and equities."
European recession and a contraction in Chinese factory activity are limiting oil use but producers are pumping at least as fast as end-users are consuming, leading to a build-up in inventories.
According to preliminary data last week, U.S. factory activity slipped to a seven-month low in May.
U.S. crude oil stockpiles are near all-time highs, while U.S. gasoline reserves are rising at a time when seasonal demand is traditionally nearing its peak. U.S. gasoline stocks are close to their highest for this time of year since 1999.
Market participants were beginning to focus on OPEC's biannual meeting in Vienna at the end of this week, said Carsten Fritsch, senior oil analyst at Commerzbank in Frankfurt.
The group is unlikely to alter its output targets, delegates say.
"Let me tell you this, this is the best environment for the market. Supplies are plentiful, demand is great, balanced -inventories are balanced," Saudi Arabian Oil Minister Ali al-Naimi told reporters on his arrival in Vienna on Tuesday.
(Additional reporting by Christopher Johnson in London and Ramya Venugopal in Chennai; Editing by Dale Hudson, David Gregorio and Chris Reese)