Bar-mode instability suppression in magnetized relativistic stars