Collapse of primordial gas clouds and the formation of quasar black holes