Resonant light-controlled self-assembly of ordered nanostructures