Demonstration of three- and four-body interactions between trapped-ion spins