Oil prices rose to a three-week high on Friday, drawing support from improved U.S. consumer confidence and further evidence of record levels of compliance by OPEC with its agreed output cuts.

U.S. crude futures were trading 99 cents higher at $52.11 a barrel by 1433 GMT (10:33 a.m. EDT), after hitting $52.37, the highest in about three weeks. Brent crude was trading 83 cents up at $51.63.

A survey showed U.S. consumers felt more confident about the economy in April than at any time since the September failure of Lehman Brothers.

Equity markets pared earlier losses on the data.

Global stocks now held near three month highs after rallies in April.

This week's gains in oil prices were fueled in part by a strong performance on stock markets, with a key European benchmark posting its biggest-ever monthly gain in April led by banks.

Oil has been supported by equity markets, reflecting the positive side of mixed economic data, Olivier Jakob at Petromatrix said.

We have built in bad news so it is not a surprise any more. The market started to see that some economic indicators (were) better than others, he said.

There are some variations during the day but if you look at the close, prices are quite stable around $50-$52.

A $50 oil price is also the level that many oil producers, including OPEC, wish to defend.

A Reuters survey showed the Organization of the Petroleum Exporting Countries (OPEC) reduced supply in April, implementing 84 percent of its agreed output cut. The compliance rate is a record high, while the average is around 60 percent.

Oil, which has collapsed from a record high of more than $147 last July, has recovered from a low of $32.40 in December and in April posted a third monthly gain of nearly 3 percent.

Still, weak oil demand in the near term and rising crude inventories in the United States -- now at their highest since 1990 -- have slowed the pace.

We remain unconvinced oil price can maintain the current levels given ballooning oil inventories and lower open interest on the futures contract, Harry Tchilinguirian, senior oil analyst at BNP Paribas said.

Traders were also still cautious about the economic impact of a deadly flu strain.

(Additional reporting by Alex Lawler and Fayen Wong in Perth; editing by Peter Blackburn)