Electric-field control of domain wall nucleation and pinning in a metallic ferromagnet