Heat the oven to 180C/356F/gas 4. Butter and line a 900g (2lb) loaf tin. Put the apricot jam, butter and sugar in a saucepan and warm over a low heat, stirring occasionally, until the butter has melted and the sugar has dissolved. Remove from the heat, stir in the milk and vanilla extract, then set aside to cool.
Tip the flour into a bowl with the baking powder and spices. Add the egg, then gently fold it into the flour along with the melted butter mixture. Once combined, pour into the prepared tin, place on a baking tray, and bake for 40 mins until springy to the touch and a skewer inserted into the middle comes out clean. Leave to cool for 10 mins in the tin, then place on a cooling rack and leave to cool completely. Sprinkle with icing sugar if using.