The International Monetary Fund warned that the war in the Middle East could throw the global economy off course, with growth expected to slow to 3.1%.