Vladimir Putin and Donald Trump said they favored cooperation in Syria to defeat Islamic State.