KABUL—The Afghan presidential race is shaping up as a messy battle with several credible candidates, fractured political alliances and only one near certainty—that the warlords who once plunged Afghanistan into civil war will play a major role in the country's future.

As the registration of candidates closed Sunday night, at least seven serious presidential aspirants had filed nominations for the April 5 vote to pick a successor to...