- Rising tension between the United States and Iran highlighted risks to oil supply.
- However, escalating trade disputes raised the prospect of slower economic growth and perhaps weaker energy demand.
- Saudi Arabia and other large producers are ramping up output to offset losses that are likely to come as sanctions on Iran take effect.
Oil prices rose on Tuesday as the market shifted focus to the possibility of increased Chinese demand, drawing attention away from trade tensions between that country and the United States after a series of tariffs imposed by both countries.
Reports on Tuesday that China will increase infrastructure spending helped lessen fears that U.S.-China trade tensions will reduce the country's demand for oil, said Phil Flynn, analyst at Price Futures Group in Chicago.
"That's going to be very bullish for oil demand," Flynn said. "Infrastructure spending from China in the past had really jacked up oil demand, and I think that's adding some outside support for prices."
In addition, after an 8 percent decline from multi-year highs, buyers are coming back into the market, said Gene McGillian, vice president of market research at Tradition Energy in Stamford, Connecticut.
With significant reductions in crude inventories because of strong global demand growth, the supply-and-demand picture will remain strong unless there are significant production increases from Russia and Saudi Arabia, McGillian said.
Both oil benchmarks have fallen this month as crude supplies from Russia, Saudi Arabia and other members of the Organization of the Petroleum Exporting Countries have increased and unscheduled production losses have eased.
Market sentiment has been driven by geopolitical worries: fears that supply could be disrupted by confrontation in the Middle East or that Washington's trade dispute with its major trading partners could dampen global growth.
"The impact on oil supplies if U.S.-Iran tensions escalate significantly cannot be underestimated," said Abhishek Kumar, senior analyst at Interfax Energy.
Iran, OPEC's third-largest producer pumping 3.75 million barrels a day, has come under increasing U.S. pressure, with the administration of President Donald Trump pushing countries to cut all imports of Iranian oil by November.
This week, Iran renewed threats to close the Strait of Hormuz, the entrance to the Persian Gulf and the world's busiest sea lane for crude shipments. Trump countered that Iran would face consequences of historic proportions if it continued to lob threats at the United States.
The United States would be able to swiftly reopen the Strait of Hormuz, but military confrontations and sporadic closures in the waterway would put upward pressure on oil prices, analysts tell CNBC.
Saudi Arabia and other large producers are ramping up output to offset losses likely to come as the November deadline approaches.
U.S. crude inventories at the U.S. crude futures delivery hub at Cushing, Oklahoma rose in the four days to Friday, according to data supplier Genscape, traders said.
Stockpiles at the hub were expected to fall for the 10th consecutive week, traders said. A Reuters survey on Monday estimated on average that total U.S. crude stocks fell by 3.2 million barrels last week, after rising in the previous week.
U.S. industry group the American Petroleum Institute will release its inventories data for last week at 4:30 p.m. EDT (2030 GMT) on Tuesday. Official U.S. Energy Department data will follow on Wednesday.
— CNBC's Tom DiChristopher contributed to this report.