…whereas an aperture of f/13 has bought the background into sharp focus
When shooting portraits, it’s best to set a wide aperture (around f/2.8-f/5.6) to capture a shallow depth of field, so the background behind your subject is nicely blurred, making them stand out better.
Shoot in Aperture Priority mode to control depth of field; in this mode your DSLR will helpfully set the shutter speed for a correct exposure.
Specialist portrait lenses tend to have even wider maximum apertures (from f/1.4 to f/2.8) in order to blur backgrounds further.
3. Shutter speed settings
When setting shutter speed, factor in your lens’s focal length otherwise camera-shake (and blurred results) will become an issue.
As a general rule, make sure your shutter speed is higher than your effective focal length. For example, at 200mm use a 1/250 sec shutter speed or faster.
This also means you can get away with slower shutter speeds when using a wide-angle lens – such as 1/20sec with an 18mm focal length.