Ion-trap simulation of the quantum phase transition in an exactly solvable model of spins coupled to bosons