NEW YORK, May 15 (Reuters) - U.S. stocks climbed on Wednesday, with the Dow and S&P 500 hitting new all-time highs as the market’s recent upward momentum persisted and offset some weak economic data.

The S&P 500 and the Nasdaq have risen for four straight sessions, extending their gains for the year. Equities have rallied in recent weeks as investors bet that central bank stimulus measures will keep supporting market gains.

Such policies have helped spur advances of about 15 percent in major indexes this year despite data showing some signs of lackluster growth.

In the latest reads on the economy, activity in New York state’s manufacturing sector unexpectedly contracted in May, falling to minus 1.43 from 3.05, below expectations for an increase to 4. Another report showed that U.S. industrial production fell 0.5 percent in April, more than expected.

“It’s disconcerting that the data was so much lower than what we were looking for, but there’s no reason for investors to sell,” said Michael Binger, senior portfolio manager at Gradient Investments in Minneapolis. “The main things driving the market - the Fed, earnings, consumer confidence - are holding up, and people put money in the market on any down day. I still see a lot of value.”

Agilent Tech was one of the S&P 500’s top percentage gainers a day after the company posted adjusted earnings that beat expectations and doubled its stock-buyback program to $1 billion. The company also said it would cut 2 percent of its global work force. Shares rose 4 percent to $45.73.

Tech shares also got a lift from Netflix Inc, up 3.9 percent at $243, and Yahoo Inc, up 3.7 percent at $27.64. In contrast, Computer Sciences Corp was the S&P 500’s biggest loser, dropping 10 percent to $44.39 after reporting results.

During the session, the Dow touched an all-time intraday high at 15,301.34, while the S&P 500 reached a record intraday peak at 1,661.49.

The Nasdaq hit a fresh 52-week high at 3,475.48.

Deere & Co fell 4.6 percent to $89.48 after the farm equipment maker gave a cautious outlook, though earnings were stronger than expected.

In other data released on Wednesday, the U.S. Producer Price Index recorded its largest drop in three years in April, falling a seasonally adjusted 0.7 percent.

The NAHB/Wells Fargo Housing Market index rose to 44 from a downwardly revised 41 in April, according to data from the National Association of Home Builders. The May reading was above forecasts and closer to the 50 mark, which indicates builders see market conditions in a more favorable light.

An improving housing market has been seen as a tailwind to the economic recovery.

Crude oil was volatile, rebounding from a drop of almost 2 percent to trade flat on the day. Oil has dropped for five straight sessions, pressured by weakness in Europe, as well as a stronger dollar and rising U.S. stockpiles.