U.S. stocks closed lower as chipmakers retreated after a rally, while uncertainty over U.S.-Iran peace talks weighed on sentiment. Losses were seen across the S&P 500, Nasdaq and Dow Jones.