Optimizing perception through dynamic modulation of effective connectivity in the brain