Total-energy-based prediction of a quasicrystal structure