The head of the U.S. Justice Department has met with Iraq 's prime minister during a surprise trip Baghdad .