The United States and the European Union agreed on a framework trade deal, which leaders on both sides of the Atlantic said would end months of uncertainty for industries and consumers.