U.S. stocks rallied Tuesday as Wall Street awaited the results of a closely contested presidential race.