The quadratic problem for stochastic linear control systems with delay