Nigeria agreed to withdraw its troops from Bakassi, a potentially oil-rich, 400-square-mile peninsula in the Gulf of Guinea it has long claimed, within 60 days.