U.S. stocks closed mostly higher Tuesday, rebounding from early losses, after gains in oil helped boost the energy sector nearly 2 percent. After the closing bell, shares of Intel Corporation (NASDAQ:INTC) jumped more than 3 percent to $32.62 after the chipmaker posted earnings in line with Wall Street expectations, while revenue came in just shy of forecasts due to sluggish sales in its personal computer business.

The Dow Jones Industrial Average (INDEXDJX:.DJI) gained 59.66 points, or 0.33 percent, to close at 18,036.70. The Standard & Poor's 500 (INDEXNASDAQ:.IXIC) added 3.41 points, or 0.16 percent, to end at 2,095.84. However, the Nasdaq composite (INDEXSP:.INX) declined 10.96 points, or -0.22 percent, to finish at 4,977.29.

Dow component Intel turned in first-quarter net income of $2 billion, or earnings per share of 41 cents, on revenue of $12.8 billion, compared with a profit of $1.95 billion, or earnings per share of 38 cents, on sales of $12.8 billion a year ago. Analysts had expected Intel to report first-quarter net income of $2.04 billion, or earnings per share of 41 cents, on revenue of $12.9 billion, said analysts polled by Thomson Reuters. 

All three major U.S. indexes initially traded lower Tuesday morning following a mixed batch of earnings from JPMorgan Chase & Co., Wells Fargo & Co., Zillow Group Inc. and Johnson & Johnson.

However, the S&P 500 energy sector gained 1.77 percent in afternoon trading Tuesday, helped by a rally in oil prices. Ensco Plc (NYSE:ESV) led the sector higher after the British offshore contract drilling company gained more than 6 percent to close at $25.18.

Oil prices closed nearly 3 percent higher Tuesday on signs of falling U.S. oil production as tensions escalated in Yemen. West Texas Intermediate crude, the benchmark for U.S. oil prices, adding 2.7 percent to $53.29 a barrel, for May 15 delivery, on the New York Mercantile Exchange. Brent crude, the benchmark for global oil prices, edged up 63 cents to $58.56 a barrel, for May 15 delivery, on the London ICE Futures Exchange.

Ahead on the economic calendar, the Federal Reserve will release its Beige Book at 2 p.m. EDT Wednesday. The central bank publishes the report eight times a year, highlighting the current condition of the U.S. economy within the Fed's 12 districts.

Notable companies reporting earnings before the opening bell Wednesday include Bank of America Corporation and Delta Air Lines Inc., followed by Netflix Inc. after the close.