UPS and its Teamsters union have signed a tentative contract deal for about 340,000 U.S. workers at the parcel delivery firm, one week ahead of a threatened strike that could have cost the economy billions and disrupted a quarter of the nation’s package shipments.