Spontaneous compactification of space in an Einstein-Yang-Mills-Higgs model