Stocks extended gains by late afternoon Tuesday as crude oil closed at its best level of the year on hopes the Organization of Petroleum Exporting Countries can agree on a production freeze.

The S&P 500 added 0.88%, the Dow Jones Industrial Average climbed 0.79%, and the Nasdaq rose 0.67%. All benchmark indexes were negative earlier in the session.

Crude oil spiked on Tuesday on unconfirmed reports Saudi Arabia and non-OPEC member Russia have agreed on a freeze. However, the Russian energy minister declined to comment on the Bloomberg reports.

OPEC members will meet on Sunday in Doha, Qatar, to discuss a potential production freeze agreement. West Texas Intermediate crude oil added 4.5% to $42.17 a barrel on Tuesday.

The energy sector was the best performer Tuesday. Major oilers Exxon Mobil (XOM - Get Report) , PetroChina (PTR - Get Report) , Total (TOT - Get Report) and BP (BP - Get Report) climbed, while the Energy Select Sector SPDR ETF (XLE - Get Report) added 3.1%.

The International Monetary Fund reduced its forecast for global growth to 3.2% in 2016, down 0.2 percentage points from its January forecast. The global organization had previously cut its 2016 outlook in October and July last year.

"Global growth continues, but at an increasingly disappointing pace that leaves the world economy more exposed to negative risks. Growth has been too slow for too long," IMF Chief Economist Maurice Obstfeld said at a press conference on Tuesday.

Starbucks (SBUX - Get Report)  declined after Deutsche Bank downgraded the stock to hold from buy. The firm said the downgrade was a valuation call based on a $64 price target. Starbucks shares fell 3.1%.

Starbucks is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells SBUX? Learn more now.

Alcoa (AA - Get Report) , which unofficially kicks off earnings season, reported weak first-quarter results after the bell Monday. Alcoa fell 3.2% after missing revenue estimates in its first quarter on an aluminum slowdown. The industry bellwether reported a 15% slide in revenue to $4.9 billion, its third straight quarter of declining sales. Analysts estimated sales of $5.2 billion. Adjusted earnings of 7 cents a share were down from 28 cents a year earlier.

The company also said it could cut up to 2,000 jobs, adding to the 600 jobs already eliminated this year and further 400 cuts planned. CEO Klaus Kleinfeld said that the layoffs would be mostly in Alcoa's aerospace-parts business and would be spread across many countries.

Forecasts for the rest of the earnings season look disappointing. Analysts anticipate earnings for companies in the S&P 500 will fall 7.9%, their fourth straight quarter of decline and the steepest drop since the second quarter of 2009.

"What managements have to say about the months ahead will be carefully watched," said David Joy, chief market strategist at Ameriprise Financial. "It is easier to overlook the immediate past if the immediate future looks brighter. And earnings growth is expected to turn positive in the year's second half. The full year forecast now estimates overall growth of 2%, as only energy, materials and telecom end the year in the red."

Lower energy prices and a stronger U.S. dollar continued to impact import prices in March. Import prices climbed just 0.2% on a month-on-month basis, far below estimates for 1% growth. February prices were revised to show a 0.3% contraction. Export prices remained flat, as expected, after a 0.4% contraction a month earlier.

The U.S. economy will likely grow just below 2% this year, meaning it will be suitable for a rate hike this year, Dallas Federal Reserve President Rob Kaplan told CNBC on Tuesday. In a speech a day earlier, Kaplan said it was likely too soon for an April hike, but a June increase could be a possibility. Kaplan is not a voting member of the policymaking committee this year.

Juniper Networks (JNPR - Get Report) slumped 7.6% after cutting its forecast for its first quarter. The networking company expects first-quarter earnings between 35 cents and 37 cents a share, below analysts' estimates of 45 cents a share. Juniper said the weaker outlook was due to softer business demand and unfavorable timing of deployment from some telecom companies.

ArcelorMittal (MT - Get Report) added 4% after its shares were added to Goldman Sachs' Conviction Buy list with a price target of 5.4 euros. The company announced plans to repurchase bonds in euros and dollars on Monday after raising cash from a recent $3 billion rights issue.