UN climate talks end with funding deal for poor nations to tackle warming