Closed-loop optimization of extracellular electrical stimulation for targeted neuronal activation