A tail inequality for quadratic forms of subgaussian random vectors