Emergence of modular structure in a large-scale brain network with interactions between dynamics and connectivity