Theory of luminescence quenching and photobleaching in conjugated polymers