Oil steadied near $64 a barrel on Tuesday, holding onto recent gains made as optimism over a global economic recovery sparked a rally in equity markets and a drop in the dollar.

With the dollar holding steady near a six-week low against a basket of currencies and Asian stocks also near unchanged, the market will turn to the release of weekly U.S. inventory data to gauge whether talk of economic recovery is translating into real demand in the world's top energy consumer.

Federal Reserve Chairman Ben Bernanke's semi-annual testimony on the U.S. economic outlook and monetary policy at 10 a.m. EDT will also provide more trading cues for the market.

U.S. crude oil for August delivery, which expires later on Tuesday, rose 7 cents to $64.05 a barrel by 10:45 p.m. EDT, after settling up 42 cents at $63.98 on Monday. London Brent crude for September fell 26 cents to $66.18.

The market is see-sawing based on people's perception of the U.S. economy -- they don't really know if the recovery is durable, and they are trading based on available data that offers clues on the outlook, said Tony Nunan, risk manager at Mitsubishi Corp in Tokyo.

But short-term fundamentals do not look strong because inventories remain high, so we're going to be stuck in the $60s to $70s range for a while, he added.

U.S. weekly crude stockpiles are forecast to have fallen by 1.8 million barrels in the week to July 17, marking the seventh straight week of decline, as slow imports countered a decline in refining activity, a Reuters poll of 10 analysts showed.

The API, an industry group, will release its data at 4:30 p.m. EDT, while the U.S. Energy Information Administration (EIA) will unveil its own report the following day at 10:30 a.m. EDT.

Federal Reserve Chairman Ben Bernanke will speak on the economic outlook and monetary policy before the House Financial Services Committee at 10 a.m. EDT, and some analysts expect he is likely to make clear there is no rush to tighten.

Bernanke, writing in the Wall Street Journal ahead of his testimony, said accommodative policies would likely be warranted for an extended period, but the Fed would need to tighten policy to prevent inflation as economic recovery takes hold.

On the supply front, Algeria's oil minister said OPEC will need to cut output again when it meets again in September if there is not enough demand for its crude.

The producer group agreed to a series of cuts last year to lop 4.2 million barrels per day (bpd) of output from global markets as part of a bid to lift flagging oil prices.

(Editing by Michael Urquhart)