Armenia, Azerbaijan agree on cease-fire to end fighting