The U.A.E. said it would withdraw its remaining forces from Yemen after Riyadh issued an ultimatum.