This is a review (including some background material) of the author's work and related activity on certain exactly solvable statistical models in two dimensions, including the six-vertex model, loop models and lozenge tilings. Applications to enumerative combinatorics (alternating sign matrices, plane partitions) and to algebraic geometry (computation of the degree of algebraic varieties) are described. The central role of the quantum Kniznhik-Zamolodchikov equation is emphasized.