United Parcel Service Inc. has agreed to buy the equivalent of 170 million gallons of renewable natural gas from Clean Energy Fuels Corp. over the next seven years in what the company described as the biggest-ever deal involving the alternative fuel.