UN-backed deal follows 14 weeks of negotiations, marking rare diplomatic momentum in nine-year conflict with 23 million facing humanitarian crisis