Let $G$ be a group containing a normal subgroup $H$ isomorphic to $D\_8$. Prove that $G$ must have a nontrivial center.

I proved that the $|Z(H)|=2$. I tried to solve further by class equation but not able to reach any conclusion.

Is there any relation between $|Z(G)|$ and $|Z(H)|$?