Iraq, U.S. sign pact to pull troops out in 3 years