* Oil rises, lifts energy stocks
* Home builders' shares rise after KB Home's upgrade
* Dow up 0.9 pct, S&P 500 up 0.8 pct, Nasdaq up 0.7 pct (Updates to midday, changes byline)
By Rodrigo Campos
NEW YORK, June 29 (Reuters) - U.S. stocks rose on Monday as higher oil prices boosted energy shares, and signs of life in overseas markets renewed investor optimism about the prospects for an economic recovery.
Crude oil futures jumped more than 3 percent to above $71 per barrel after Nigerian militants said they attacked the country's infrastructure, raising supply concerns that helped offset lackluster demand reflected in U.S. government data. Oil prices also got a lift as improved sentiment about the U.S. economy drove stocks higher and increased hopes for growth in energy demand.
Energy shares gained, with Exxon Mobil Corp up 1.9 percent at $70.35, and Occidental Petroleum up 1.9 percent at $65.52.
Shanghai stocks reached a one-year closing high for the fourth straight session as signs of a Chinese economic recovery and ample liquidity boosted the market, bolstering investor sentiment.
"On a very short-term basis, the American investor is taking comfort from international markets, which have had decent activity," said Joseph Battipaglia, market strategist at Stifel Nicolaus in Yardley, Pennsylvania.
"The commodities trade is obviously still on, with oil prices breaking through $70 again."
The Dow Jones industrial average gained 78.29 points, or 0.93 percent, to 8,516.68. The Standard & Poor's 500 Index rose 7.67 points, or 0.83 percent, to 926.57. The Nasdaq Composite Index added 12.84 points, or 0.70 percent, to 1,851.05.
The S&P 500 is up 16.1 percent for the quarter ending on Tuesday, despite a gain of just 0.81 percent so far in June. It could be the best quarter for the broad index since the fourth quarter of 1998, when it jumped nearly 21 percent.
Shares of home builder KB Home shot up 6.4 percent to $14.28 after Credit Suisse raised its rating on the company's stock, citing stronger orders and more attractive valuation. The Dow Jones U.S. Home Construction Index advanced 1.5 percent.
Microsoft Corp, up 2.3 percent at $23.88, gave a boost to both the Dow industrials and the Nasdaq after Deutsche Bank raised its price target on the stock to $30 from $22.
But the biotech sector limited gains in the Nasdaq 100 after Deutsche Bank cut its rating on Biogen Idec to "hold" from "buy," saying the shares were now fairly valued. The stock fell 5.9 percent to $47.10. (Editing by Jan Paschal)