As Sandor points out, this is Stein factorization. Let $X$, $Y$ be varieties over a field $K$. Let $h: X\to Y$ be a proper morphism. Then $h_*(O_X)$ is coherent and $Y':=Spec(h_*(O_X))$ (cf. EGA II for the definition of $Spec$ of a sheaf of quasicoherent algebras) is finite over $Y$. Consider the Stein factorization $$h:X\buildrel h' \over\longrightarrow Y'\buildrel g\over \longrightarrow Y$$ of $h$. (It is true by Zariski's connectedness theorem (cf. EGA III.4.3.1 - III.4.3.4) that $h'$ has non-empty geometrically connected fibres and $g$ is finite, but this will not be needed here).
Now assume that $h$ is an alteration, i.e. that $h$ is surjective and that there exists a nonempty open subscheme $U\subset Y$ such that $h^{-1}(U)\to U$ is finite. Replacing $U$ by a smaller set we may assume that $U=Spec(A)$ is affine. Define $U'=g^{-1}(U)$ and $V=h^{-1}(U)$. Then $V=\Spec(B)$ is affine, because $h$ is finite, and $h_*(O_X)(U)=B$. Hence it follows from the definition of the sheaf Spec that $U'=Spec(B)$ and $h': V\to U'$ is an isomorphism. Hence $h'$ is a modification. Note that one does not use Zariski's connectedness theorem in an essential way here.
Concerning your comment, the following is true: If $f: X\to Y$ is a finite morphism and $f_*(O_X)=O_Y$, then $f$ is an isomorphism.