The developing world is embarking on a massive infrastructure boom. And China wants to build it—and bankroll it.

On Thursday, Chinese officials announced the latest infrastructure megaproject—a $12 billion contract to build a railway stretching more than 850 miles (1,400 kilometers) along the coast of Nigeria. It was China's single-biggest overseas contract, according to state media.