Brent crude futures rose $2.88, or 4.2%, to settle at $72.23 a barrel. U.S. West Texas Intermediate (WTI) crude futures rose $3.1, or 4.6%, to settle at $70.30 a barrel.

Futures are rebounding after dropping around 7% on Monday, following a deal by the Organization of Petroleum Exporting Countries and allies, together known as OPEC+, to boost supply by 400,000 barrels per day from August through December.

The sell-off was exacerbated by fears that a rise in cases of the Delta variant of the coronavirus in major markets like the United States, Britain and Japan would affect demand.

"Overall the OPEC agreement has crystallized what the market should expect as to the restoration of production," said Andy Lipow, president of Lipow Oil Associates. "However, even according to OPEC+ numbers, it's not enough to stem the overall world oil inventory decline, and to me, that is giving support to the market."

The price gains on Wednesday come despite a rise in U.S. crude stockpiles for the first time since May. Crude inventories rose unexpectedly by 2.1 million barrels last week to 439.7 million barrels, U.S. Energy Information Administration data showed. Analysts had expected a 4.5 million-barrel drop. [EIA/S]

Still, gasoline and distillate inventories posted draws of 121,000 barrels and 1.3 million barrels, respectively.

"That crude oil build was obviously a surprise driven by a surge in imports and a plunge in exports," said John Kilduff, partner at Again Capital in New York. "The only positive aspects of the report remain strong gasoline demand and a rebound in distillate fuels."

JPMorgan analysts said global demand is expected to average 99.6 million barrels per day (mbd) in August, up by 5.4 mbd from April. But they also said: "We only see 4Q21 demand recovering another incremental 330,000 vs a normalised 2019 baseline as colder weather sets in for the northern hemisphere and peak travel season is behind us."

(Additional reporting by Ahmad Ghaddar in London, Sonali Paul in Melbourne and Roslan Khasawneh in Singapore; editing by Kirsten Donovan, Lisa Shumaker and Nick Macfie)

By Stephanie Kelly