In this work we present numerical analysis for a distributed optimal control problem, with box constraint on the control, governed by a subdiffusion equation that involves a fractional derivative of order alpha is an element of (0,1) in time. The fully discrete scheme is obtained by applying the conforming linear Galerkin finite element method in space, L1 scheme/backward Euler convolution quadrature in time, and the control variable by a variational-type discretization. With a space mesh size h and time stepsize tau we establish the following order of convergence for the numerical solutions of the optimal control problem: O(tau(min(1/2+alpha-is an element of,1)) +h(2)) in the discrete L-2(0, T; L-2(Omega)) norm and O(tau(alpha-is an element of) + l(h)(2)h(2)) in the discrete L-infinity(0, T; L-2(Omega)) norm, with any small epsilon > 0 and l(h) = ln(2 + 1/h). The analysis relies essentially on the maximal LP-regularity and its discrete analogue for the subdiffusion problem. Numerical experiments are provided to support the theoretical results.