Good vibes over a dovish Federal Reserve overflowed into Wednesday's session, extending the Tuesday rally that pushed stocks back into positive territory for the year.

The S&P 500 added 0.44%, the Dow Jones Industrial Average rose 0.48%, both touching the highest levels this year, and the Nasdaq was up 0.47%.

While the Dow had gained nearly 140 points at its session high, stocks nonetheless pared some gains during the afternoon as a rally in crude oil lost momentum. 

Crude had initially spiked after U.S. inventories climbed 2.3 million barrels in the past week, less than the 2.6 million analysts had projected. The rally proved unsustainable, however, as traders fretted that any increase at all exacerbates the current supply glut on domestic and global markets. West Texas Intermediate crude oil closed 0.1% higher at $38.32 a barrel.

Stocks rallied a day earlier after Fed Chair Janet Yellen stressed caution in raising interest rates, reiterating that they would probably climb only gradually. The central bank's monetary policy committee should "proceed cautiously" in adjusting interest rates, Yellen said Tuesday during a speech in New York.

"The U.S. central bank is being more dovish. The odds of recession [are] lower," Steve Chiavarone, associate portfolio manager at Federated Investors, told TheStreet. "What has not happened, however, is a real improvement in the growth picture. Earnings continue to look pretty sluggish, economic data remains relatively mixed... For the bull to continue, things have to actually get [better] and it really hasn't happened yet."

An impressive 200,000 jobs were added to the private sector in March, according to the ADP National Employment Report. The official U.S. jobs report will be released on Friday. Economists anticipate 210,000 jobs to have been added to nonfarm payrolls in March, while the unemployment rate is expected to hold steady at 4.9%.

Lululemon (LULU - Get Report) added more than 10% after fourth-quarter profit rose 6%, better than analysts expected. Still, the athletic apparel brand projected a soft first quarter, with earnings no higher than 30 cents a share, which is 7 cents less than consensus.

Drive-in restaurant chain Sonic (SONC) climbed 5% after topping quarterly estimates and issuing better-than-expected forecasts. The company said second-quarter profit jumped 41%, driven by strong sales of its limited-time offers. Sonic anticipates full-year adjusted earnings to rise 20% to 25%, above previous guidance of 16% to 20%.

Valeant Pharmaceuticals (VRX) fell 6.6% after seeking a credit-facility amendment and requesting an extension to file its annual report with the Securities and Exchange Commission on May 31. The embattled drugmaker said it's comfortable with its current liquidity position.

Apple (AAPL - Get Report)  , a holding in Jim Cramer's Action Alerts PLUS portfolio, climbed after Cowen & Co. analysts upgraded the stock to outperform from market perform. The firm said the tech giant will benefit from an upcoming upgrade cycle, with consumer replacing old gadgets with the newest model.