By Barani Krishnan

NEW YORK (Reuters) - Oil prices rose nearly 3 percent on Thursday, with U.S. crude advancing firmly above the $40-per-barrel mark on short-covering and after a modest stockpile drop at the delivery hub for U.S. crude futures.

It was a second straight day of gains for crude futures from April lows below $40, after Wednesday's 3 percent run-up powered by data showing a hefty U.S. gasoline inventory drawdown.

Market intelligence firm Genscape reported that stockpiles at the Cushing, Oklahoma delivery hub for U.S. crude futures fell 89,071 barrels during the week to Aug. 2, traders who saw the data said. The Genscape report came after U.S. government data on Wednesday showed a 1.1 million-barrel decline at Cushing in the week to July 29.

Sources said BP PLC <BP.L> was restarting units at its 413,500-barrel per day refinery in Whiting, Indiana, and that added momentum to the crude rally, according to traders. The weekend outage of the reformer and blending oil unit had prompted BP to cut production by between 20 and 25 percent.

Brent crude <LCOc1> settled up $1.19, or 2.8 percent, at $44.29 a barrel.

U.S. West Texas Intermediate (WTI) crude <CLc1> rose $1.10, or 2.7 percent, to settle at $41.93 per barrel. In the previous session, it rose 3 percent, after settling below $40 on Tuesday, the first time since April.

"We're sitting pretty, with our customers extremely happy at having profited from WTI option hedges at under $40, and are now long again for $45-$55 levels," said Salvatore Recco, who advises on some $2 billion of client money at Gravity Investments in Denver, Colorado.

Before the slump below $40, speculators, including hedge funds, added the equivalent of 56 million barrels of extra short positions in the three main Brent and WTI futures and options contracts in the week ending July 26.

U.S. gasoline futures <RBc1>, however, ended up only 1.3 percent higher on Thursday, with the gasoline crack <1RBc1-CLc1>, an indicator of refining profits, falling for the first time in six sessions.

WTI's drop below $40 earlier this week had hardened the resolve of oil market bears to drive prices lower as oversupply, refining cutbacks and a breakdown in the oil/dollar trade appeared to spell an end to this year's rally.

Data from Iraq's state oil marketer showed the OPEC member's July crude production at its highest since January at 4.6 million barrels per day.

Stockpiles of middle distillates in Singapore were at a five-year high year, adding to worries of a worldwide petroleum glut.

The Cushing draw aside, total U.S. crude stocks rose for a second straight week, gaining 1.4 million barrels last week, contrary to analysts' forecasts for an identical draw.

"Our long standing WTI-Brent targets of $37-38 remain as high probability and position type shorts represent a hold," said Jim Ritterbusch of Chicago-based oil markets consultancy Ritterbusch & Associates.

(Additional reporting by Ahmad Ghaddar in; LONDON and Henning Gloystein in SINGAPORE; Editing by David Evans and Marguerita Choy)