Countries fail to reach agreement on text, which omitted mentions of fossil fuels, after hours of negotiations in Turkey