Optimal blocking of two-level factorial designs