US stocks closed at record highs as the S&P 500 and Nasdaq rallied on reports of a possible US Iran ceasefire extension.