Particle physics underpins our understanding of the world at a fundamental level by describing the interplay of matter and forces through gauge theories. Yet, despite their unmatched success, the intrinsic quantum mechanical nature of gauge theories makes important problem classes notoriously difficult to address with classical computational techniques. A promising way to overcome these roadblocks is offered by quantum computers, which are based on the same laws that make the classical computations so difficult. Here, we present a quantum computation of the properties of the basic building block of two-dimensional lattice quantum electrodynamics, involving both gauge fields and matter. This computation is made possible by the use of a trapped-ion qudit quantum processor, where quantum information is encoded in d different states per ion, rather than in two states as in qubits. Qudits are ideally suited for describing gauge fields, which are naturally high-dimensional, leading to a dramatic reduction in the quantum register size and circuit complexity. Using a variational quantum eigensolver we find the ground state of the model and observe the interplay between virtual pair creation and quantized magnetic field effects. The qudit approach further allows us to seamlessly observe the effect of different gauge field truncations by controlling the qudit dimension. Our results open the door for hardware-efficient quantum simulations with qudits in near-term quantum devices.