UK government was hacked in October, minister confirms