A stochastic control problem with delay arising in a pension fund model