Excitonic pathway to photoinduced magnetism in colloidal nanocrystals with nonmagnetic dopants