- Oil markets have fallen over the last week as Saudi Arabia, other members of OPEC and Russia increased production and as some supply disruptions eased.
- Investors are also worried about the U.S.-China trade dispute's impact on economic growth and energy demand.
- Preliminary data from the American Petroleum Institute showed an unexpected rise of over 600,000 barrels in U.S. crude inventories.
Oil prices reversed early losses on Wednesday after the market absorbed government data that showed a surprise build in U.S. crude inventories, but also indicated some bullish demand for gasoline.
U.S. West Texas Intermediate crude ended the session up 68 cents, or 1 percent, at $68.76, after earlier falling towards Tuesday's one-month low of $67.03 per barrel.
Brent futures rose 68 cents, or nearly 1 percent, to $72.84 by 2:25 p.m. ET, after falling nearly a dollar to a low of $71.19 a barrel, its weakest since April 17.
U.S. crude stocks surprised the market and rose by 5.8 million barrels last week as oil production hit 11 million barrels a day for the first time ever, the Energy Information Administration said on Wednesday.
Crude futures extended losses immediately following the data release, before edging higher as the market weighed some of the more supportive points in the report, such as a larger-than-expected draw in gasoline stocks.
Gasoline inventories fell by 3.2 million barrels, while distillate stockpiles, which include diesel and heating oil, fell by 371,000 barrels, the EIA data showed.
"Even though the overall crude number was bearish, the gasoline numbers and distillate numbers were pretty bullish," said Phil Flynn, an analyst at Price Futures Group in Chicago. "We're back to worrying about a tight market."
Figures showing refineries processing plenty of crude and stockpiles dropping at the Cushing, Oklahoma delivery hub also supported the market, said John Kilduff, founding partner at energy hedge fund Again Capital.
"The pressure is still on from the demand side of the equation here, from refiners, from consumers driving," he told CNBC.
"The storage levels at Cushing are starting to get alarming."
The market also got a boost from reports that rebels in Yemen attacked an oil facility in Saudi Arabia, Kilduff said.
The Iran-aligned Houthi movement in Yemen said on Wednesday that one of its drones had attacked the Saudi state oil company Aramco refinery in Riyadh, according to Houthi-run al-Masira TV, based in Yemen.
Aramco earlier said its fire control teams and the Saudi civil defense had contained a limited fire that erupted in the early evening in a storage containers at the refinery.
Oil markets have fallen over the last week as Saudi Arabia and other members of the Organization of the Petroleum Exporting Countries and Russia increased production and as some supply disruptions eased.
"The correction in the oil price represents something of a convergence between fundamentals and physical realities," said David Reid, lead crude market analyst at consultancy JBC Energy.
"We expect a fairly rapid lengthening in the (global oil supply) balance," Reid added.
Investors have also begun to worry about the impact on economic growth and energy demand of the trade dispute between the United States and its trading partners, including China.
Trade tension between the United States and China could drag on the global economy, BMI Research said.
"The economic outlook is broadly positive, but a number of headwinds are emerging, not least a stronger dollar, rising inflationary pressures and tightening liquidity," BMI said. "Slowing trade growth will weigh on physical demand for oil."
Kansas City Federal Reserve Bank President Esther George said on Tuesday uncertainty over U.S. trade policy could slow the economy, even if recently imposed tariffs are too small to have a big impact.
Trade policy was a "significant" downside risk to the outlook for economic growth, George said.
— CNBC's Tom DiChristopher contributed to this report.