The next possibility to consider is the electromagnetic force, which causes opposite charges to attract and like charges to repel. However, the solar nebula was basically neutral as it was forming (it had no charge bias). The electromagnetic force thus couldn't have caused the solar nebula to collapse either.
The only force left is the one that (we hope!) popped into your head to begin with, because gravity is the force that controls almost everything important in astronomy. The gravitational attraction of the various particles of gas and dust in the solar nebula to each other caused the entire cloud to collapse into the solar system we know today.