Lebanon’s Saad al-Hariri withdrew as a candidate for prime minister on Wednesday, and Shiite Hezbollah with its ally Amal moved toward nominating a former education minister for the job, two senior sources familiar with their position said.