Collective molecular switching in hybrid superlattices for light-modulated two-dimensional electronics