The Libyan army has issued an ultimatum to residents of the opposition capital Benghazi, warning them to leave rebel-held locations.