The Dow Jones rose 40.68 points to 18,202.62 while the wider S&P 500 edged up 4 points to 2,144.29.
Oil prices rose over 2% after figures suggested a drop in US stockpiles. Shares in Chevron added 0.5% and Chesapeake Energy climbed 3.1%.
The tech-focused Nasdaq rose just 2.6 points to 5,246.41, with Intel down nearly 6% after its latest results.
Intel reported better-than-expected third-quarter earnings and revenue, but its shares were hit after its forecast for fourth-quarter revenues fell slightly short of expectations.
Intel is predicting revenues of $15.7bn in the quarter, plus or minus $500m, compared with analysts' expectations of $15.86bn.
Morgan Stanley shares rose 1.9% after the bank reported a 62% jump in third-quarter earnings to $1.5bn.
Like the other major US investment banks, Morgan Stanley's results were boosted by a big increase in bond trading, with revenues from that activity rising to $1.5bn in the quarter from $583m a year earlier.
Volumes of bond trading have been strong in recent months, partly due to the UK's vote to leave the EU and also due to speculation about moves in US interest rates.

"Celtic have brought in the higher-class player, I think," said former Celtic midfielder MacLeod.
"When you are bringing players from Liverpool, boys who have played at Man City - it is good quality players they have brought in.
"But Rangers have brought in good quality as well."
Former Arsenal, Manchester City and Liverpool defender Kolo Toure and winger Scott Sinclair, formerly of Man City and Aston Villa, have been recruited by new Celtic manager Brendan Rodgers.
Meanwhile, Rangers counterpart Mark Warburton's big-name additions are former Burnley midfielder Joey Barton and his former QPR team-mate, Niko Kranjcar.
"I think Rangers fans will be going into this game hoping they all produce a good performance on the day," said MacLeod looking ahead to Saturday's first Old Firm game of the season at Celtic Park.
"But Celtic fans will be looking at their team and thinking they are a strong side, quicker, better and they can win the match."
However, MacLeod pointed out that the Old Firm occasion has sometimes proved too much for some notable names to handle.
"There have been a lot of players and even big-name players who have turned up for an Old Firm game and not played well," he said.
"Some players in the past, you have looked at them and thought that he will be great addition to the club and they have not produced anything.
"You have to wait until the game actually happens and then decide how well they have played."
MacLeod believes Leigh Griffiths could be the difference between the teams in Saturday's Old Firm derby - as long as the striker recovers from injury.
The 26-year-old missed Scotland's 2018 World Cup qualifying win in Malta on Sunday with a hamstring complaint, but Celtic are confident he will recover in time to face Rangers in their first Premiership encounter of the season.
"In any Old Firm game, you need people who can score goals and, when you have got Griffiths fully fit, that is so important because I think he is the one that will get goals," said MacLeod.
"Griffiths is the guy you look at that is going to score, whether from outside the box or inside the box. He is a predator and he will score goals for you at all levels."
(Close): US markets closed higher, with energy stocks lifted by rising oil prices.
[NEXT_CONCEPT]
Celtic have got the better of Rangers in the summer transfer market, according to former Bhoys assistant manager Murdo MacLeod.