UPS and the Teamsters union have reached a contract agreement, avoiding the biggest strike from a single employer in United States history.