U.S. stocks climbed in afternoon trading on Tuesday, lifting both the Dow and S&P 500 to record highs as health care shares extended this week's gains.