Electron acceleration in a nonlinear shock model with applications to supernova remnants