U.S. markets posted gains Tuesday, bouncing back after three negative sessions fueled by concerns over the rapidly spreading Omicron COVID-19 variant.