International audienceWe uncover a connection between two seemingly separate subjects in integrable models: the representation theory of the affine Temperley-Lieb algebra, and the algebraic structure of solutions to the Bethe equations of the XXZ spin chain. We study the solution of Bethe equations analytically by computational algebraic geometry, and find that the solution space encodes rich information about the representation theory of Temperley-Lieb algebra. Using these connections, we compute the partition function of the completely-packed loop model and of the closely related random-cluster Potts model, on medium-size lattices with toroidal boundary conditions, by two quite different methods. We consider the partial thermodynamic limi...