Understanding exotic forms of magnetism in quantum mechanical systems is a central goal of modern condensed matter physics, with implications from high temperature superconductors to spintronic devices. Simulating magnetic materials in the vicinity of a quantum phase transition is computationally intractable on classical computers due to the extreme complexity arising from quantum entanglement between the constituent magnetic spins. Here we employ a degenerate Bose gas confined in an optical lattice to simulate a chain of interacting quantum Ising spins as they undergo a phase transition. Strong spin interactions are achieved through a site-occupation to pseudo-spin mapping. As we vary an applied field, quantum fluctuations drive a phase transition from a paramagnetic phase into an antiferromagnetic phase. In the paramagnetic phase the interaction between the spins is overwhelmed by the applied field which aligns the spins. In the antiferromagnetic phase the interaction dominates and produces staggered magnetic ordering. Magnetic domain formation is observed through both in-situ site-resolved imaging and noise correlation measurements. By demonstrating a route to quantum magnetism in an optical lattice, this work should facilitate further investigations of magnetic models using ultracold atoms, improving our understanding of real magnetic materials.