President George W. Bush has made a surprise trip to Baghdad to consult with the new Iraqi prime minister.