US stocks
Traders work on the floor of the New York Stock Exchange (NYSE) in New York, on 20 April 2017 REUTERS/Brendan McDermid

US stocks closed higher on Monday (15 May), with the S&P 500 and Nasdaq Composite hitting record highs off a rise in tech and oil prices.

The S&P 500 gained 11.42 points, or 0.5%, to settle at 2,402.32. The materials sector led advancers, while energy also performed well, CNBC reported. A sharp rise in crude prices boosted energy shares.

West Texas Intermediate futures rose 2.11% to settle at $48.85 per barrel after Russia and Saudi Arabia agreed to extend a production cut until March 2018. "This is a snap-back rally in crude," Joe Sowin, head of global equity trading at Highland Capital Management told CNBC. "The rubber band had stretched too long below $55 per barrel; now we're around $50."

However, Jason Pride, director of investment strategy at Glenmede, warned that an increase production from the US could stunt energy's gains. "Our Take: Oil should trade in the $50-70 range as increased demand is met by supply from US share oil producers," Pride said in a note.

Meanwhile, the Nasdaq Composite added 28.44 points, or 0.5%, to close at 6,149.67. Gains were led by tech giants, including Facebook, Alphabet and Apple.

The Dow Jones Industrial Average also managed gains on Monday, rising 85.33 points, or 0.4%, to end at 20,981.94. According to MarketWatch, Cisco Systems Inc and Johnson & Johnson were the blue chips gauge's top performers, each gaining more than 2%.

Colin Cieszynski, chief market strategist at CMC Markets, warned against reading too much into the market's recent upward trend, MarketWatch reported.

"Despite the gains, the S&P is still struggling with 2,400 and the Dow has remained unable to regain 21,000. We're still just at the start of the seasonally weaker half of the year for stocks and I'm still of the mind that the rally which started back in November may be running on fumes," Cieszynski said.

Gold and silver rose, up 0.2% and 1.2% respectively, while copper gained 0.6%. The US dollar traded lower against a basket of currencies.