Warring groups in Sudan have agreed to form a "government of peace and unity" in a region that has been devastated by almost two yeas of war.