The UN Security Council on Tuesday hailed an agreement reached by Libya's rival political groups that paves the way for elections to be held within two years.