We use 2D particle-in-cell ( PIC ) simulations to study the effect of the saturated whistler instability on the viscous heating and nonthermal acceleration of electrons in a shearing , collisionless plasma with a growing magnetic field , B . In this setup , an electron pressure anisotropy with p _ { \perp,e } > p _ { ||,e } naturally arises due to the adiabatic invariance of the electron magnetic moment ( p _ { ||,e } and p _ { \perp,e } are the pressures parallel and perpendicular to B ) . If the anisotropy is large enough , the whistler instability arises , efficiently scattering the electrons and limiting \Delta p _ { e } ( \equiv p _ { \perp,e } - p _ { ||,e } ) . In this context , \Delta p _ { e } taps into the plasma velocity shear , producing electron heating by the so called anisotropic viscosity . In our simulations , we permanently drive the growth of | \textbf { { B } } | by externally imposing a plasma shear , allowing us to self-consistently capture the long-term , saturated whistler instability evolution . We find that besides the viscous heating , the scattering by whistler modes can stochastically accelerate electrons to nonthermal energies . This acceleration is most prominent when initially \beta _ { e } \sim 1 , gradually decreasing its efficiency for larger values of \beta _ { e } ( \equiv 8 \pi p _ { e } / | \textbf { { B } } | ^ { 2 } ) . If initially \beta _ { e } \sim 1 , the final electron energy distribution can be approximately described by a thermal component , plus a power-law tail with spectral index \sim 3.7 . In these cases , the nonthermal tail accounts for \sim 5 \% of the electrons , and for \sim 15 \% of their kinetic energy . We discuss the implications of our results for electron heating and acceleration in low-collisionality astrophysical environments , such as low-luminosity accretion flows .