Dow, S&P retreat from records as US stocks close lower