U.S. stocks closed lower, ending three consecutive days of gains as investors remained cautious ahead of earnings season.