Which factor primarily contributed to the development of nationalist movements in Latin America during the early nineteenth century?