Set the oven to 180°C/Gas Mark 4. Put the potatoes into a heatproof bowl with 175ml (6fl oz) water and microwave on High for 10 mins, until tender. (Alternatively, boil the potatoes in a pan.)
Drain the potatoes, add the milk and mash them until smooth.
Cream the butter and the sugar, until pale and fluffy. Gradually beat in the eggs and vanilla extract.
Fold in the flour and mashed potato. Spoon into the prepared tin and bake for 45 mins, until a skewer inserted into the centre, comes out clean.
Spread the jam over the top of the the warm sponge and sprinkle with coconut. Cool, then cut into 18 squares. Serve with custard, if you like.