U.S. stocks have climbed to record levels after key companies have reported strong earnings, pointing to a rebound in consumer spending.