Libyan army agrees partial ceasefire with militias