The evolution of the UV luminosity and stellar mass functions of Lyman-α emitters from z ∼ 2 to z ∼ 6