The Dow Jones Industrial Average closed in record territory for the first time in 2014, underscoring U.S. stocks’ yearlong struggle to gain ground following last year’s rally.