Tech companies led a broad rally for U.S. stocks Tuesday, a boost for the market in a holiday-shortened trading session.