Oil prices edged above $59 a barrel on Tuesday to set a new six-month high, mainly in response to firmer equities and a weaker dollar.

U.S. crude rose 65 cents to $59.15 a barrel at 0817 GMT (4:17 a.m. EDT). It earlier touched a new six-month high of $59.49 a barrel.

London Brent crude rose 37 cents to $57.85.

The U.S. dollar is slightly weaker which could be spurring a bit of strength, said Tony Machacek at Bache Commodities Ltd.

Oil, which is priced in U.S. dollars, tends to rise when the dollar falls.

The global downturn has pushed oil down from a record high above $147 a barrel hit in July.

But prices have rebounded this year, driven partly by a rally in global equity markets, reflecting perceptions that the worst of the recession might be over in some countries.

U.S. crude is up about 80 percent from a January low of $32.70 a barrel.

Crude oil demand in China, the world's second largest energy user, provided support for prices with Chinese customs confirming on Tuesday that crude imports in April rose to reach the second-highest daily rate on record.

But the country's export data proved disappointing.

U.S. oil inventory data due on Wednesday is forecast to show a further rise in crude oil stocks.

U.S. crude stockpiles probably rose for the 10th straight time last week, up by 1.2 million barrels. Distillate stocks are likely to have risen by 1.1 million and gasoline stocks by 500,000 barrels, a preliminary Reuters poll showed.

(Reporting by Jane Merriman in London and Chua Baizhen, editing by Anthony Barker)