Lattice contraction in photochromic yttrium hydride