Countries agree on Pacific trade pact that excludes U.S.