* S&P stock index extends gains on U.S. housing data
* U.S. gasoline demand rose 1.4 pct last wk: SpendingPulse
* Dollar gains ahead of EU summit on Greek debt crisis
* Coming up: US weekly oil inventory data (4:30 p.m. EDT) (Adds detail and updates prices)
By Joshua Schneyer
NEW YORK, March 23 (Reuters) - Oil prices rose slightly to near $82 a barrel on Tuesday as improving U.S. housing data and a boost in stock prices offset a stronger dollar that has kept oil from rising further.
U.S. crude for May delivery <CLc1> , a new monthly contract that began trading on Tuesday, rose 31 cents a barrel to settle at $81.91. London Brent crude for May <LCOc1> settled up 16 cents at $80.70 a barrel.
Boosting economic optimism in the world's biggest oil consumer, sales of existing U.S. homes fell less than forecast in February, according to the National Association of Realtors on Tuesday. [
]U.S. stock markets extended Monday's gains, with the S&P 500 index up 0.6 percent, helping to prop up commodities prices. [
]But a firming U.S. dollar helped to keep oil prices from rising further, as concern over Greece's debt crisis pushed down the euro amid uncertainty about who might step in to bail out Greece. [
]A summit scheduled for later this week has done little to curb flight-to-safety and money continues to flow out of commodities and into assets perceived as safe havens, such as the dollar.
Commodities often move inversely to the dollar as they are priced in the U.S. currency and become more expensive when the dollar strengthens.
"We are paralleling the swings in the dollar and the broader financial markets," said Gene McGillian of Tradition Energy in Connecticut. "There's anemic demand for fuel, and we haven't yet seen the (crude) inventory levels come down."
U.S. stockpiles of crude oil likely rose last week by 1.5 million barrels as imports rose and refiners kept demand stable, according to an updated Reuters' poll of 16 analysts published Tuesday. [
]Industry group American Petroleum Institute will release weekly U.S. oil supply data at 4:30 p.m. EDT (2030 GMT), while the more authoritative U.S. Department of Energy weekly stocks data is due early Wednesday.
Retail demand for gasoline in the United States, the largest consumer, expanded 1.4 percent in the week to March 19, according to a MasterCard SpendingPulse report issued Tuesday. [
]Oil prices have traded in a range between $75 and $84 a barrel so far this year and high global oil inventories have prevented oil from rising more sharply even amid indications that global economies are recovering from the worst recession in decades, as fuel demand fails to recover at a similar pace.
Oil prices have traded above $83 on four occasions this month, but failed to hold the gains, partly due to fears of oversupply of oil. World oil demand remains well below its level in 2007, before record prices and recession slashed consumption and global oil inventories are well above their five-year average. (Additional reporting by Christopher Johnson in London; Editing by Lisa Shumaker)