Let $n$ be the degree of $\mathcal{L}|_E$ as in Lemma \ref{lemma-lift-sections-and-h1}. Observe that $n > 0$ as $\mathcal{L}$ is ample on $E$ (Varieties, Lemma \ref{varieties-lemma-ample-curve} and Properties, Lemma \ref{properties-lemma-ample-on-closed}). After replacing $\mathcal{L}$ by a power we may assume $H^i(X, \mathcal{L}^{\otimes e}) = 0$ for all $i > 0$ and $e > 0$, see Cohomology of Schemes, Lemma \ref{coherent-lemma-vanshing-gives-ample}. Finally, after replacing $\mathcal{L}$ by another power we may assume there exist global sections $t_0, \ldots, t_n$ of $\mathcal{L}$ which define a closed immersion $\psi : X \to \mathbf{P}^n_S$, see Morphisms, Lemma \ref{morphisms-lemma-finite-type-over-affine-ample-very-ample}. \medskip\noindent Set $\mathcal{M} = \mathcal{L}(nE)$. Then $\mathcal{M}|_E \cong \mathcal{O}_E$. Since we have the short exact sequence $$ 0 \to \mathcal{M}(-E) \to \mathcal{M} \to \mathcal{O}_E \to 0 $$ and since $H^1(X, \mathcal{M}(-E))$ is zero (by Lemma \ref{lemma-lift-sections-and-h1} and the fact that $n > 0$) we can pick a section $s_{n + 1}$ of $\mathcal{M}$ which generates $\mathcal{M}|_E$. Finally, denote $s_0, \ldots, s_n$ the sections of $\mathcal{M}$ we get from the sections $t_0, \ldots, t_n$ of $\mathcal{L}$ chosen above via $\mathcal{L} \subset \mathcal{L}(nE) = \mathcal{M}$. Combined the sections $s_0, \ldots, s_n, s_{n + 1}$ generate $\mathcal{M}$ in every point of $X$ and therefore define a morphism $$ \varphi : X \longrightarrow \mathbf{P}^{n + 1}_S $$ over $S$, see Constructions, Lemma \ref{constructions-lemma-projective-space}. \medskip\noindent Below we will check the conditions of Lemma \ref{lemma-contraction}. Once this is done we see that the Stein factorization $X \to X' \to \mathbf{P}^{n + 1}_S$ of $\varphi$ is the desired contraction which proves (1). Moreover, the morphism $X' \to \mathbf{P}^{n + 1}_S$ is finite hence $X'$ is proper over $S$ (Morphisms, Lemmas \ref{morphisms-lemma-finite-proper} and \ref{morphisms-lemma-composition-proper}). This proves (2). Observe that $X'$ has an ample invertible sheaf. Namely the pullback $\mathcal{M}'$ of $\mathcal{O}_{\mathbf{P}^{n + 1}_S}(1)$ is ample by Morphisms, Lemma \ref{morphisms-lemma-pullback-ample-tensor-relatively-ample}. Observe that $\mathcal{M}'$ pulls back to $\mathcal{M}$ on $X$ (by Constructions, Lemma \ref{constructions-lemma-projective-space}). Finally, $\mathcal{M} = \mathcal{L}(nE)$. Since in the arguments above we have replaced the original $\mathcal{L}$ by a positive power we conclude that the invertible $\mathcal{O}_{X'}$-module $\mathcal{L}'$ mentioned in (3) of the lemma is ample on $X'$ by Properties, Lemma \ref{properties-lemma-ample-power-ample}. \medskip\noindent Easy observations: $\mathbf{P}^{n + 1}_S$ is Noetherian and $\varphi$ is proper. Details omitted. \medskip\noindent Next, we observe that any point of $U = X \setminus E$ is mapped to the open subscheme $W$ of $\mathbf{P}^{n + 1}_S$ where one of the first $n + 1$ homogeneous coordinates is nonzero. On the other hand, any point of $E$ is mapped to a point where the first $n + 1$ homogeneous coordinates are all zero, in particular into the complement of $W$. Moreover, it is clear that there is a factorization $$ U = \varphi^{-1}(W) \xrightarrow{\varphi|_U} W \xrightarrow{pr} \mathbf{P}^n_S $$ of $\psi|_U$ where $pr$ is the projection using the first $n + 1$ coordinates and $\psi : X \to \mathbf{P}^n_S$ is the embedding chosen above. It follows that $\varphi|_U : U \to W$ is quasi-finite. \medskip\noindent Finally, we consider the map $\varphi|_E : E \to \mathbf{P}^{n + 1}_S$. Observe that for any point $x \in E$ the image $\varphi(x)$ has its first $n + 1$ coordinates equal to zero, i.e., the morphism $\varphi|_E$ factors through the closed subscheme $\mathbf{P}^0_S \cong S$. The morphism $E \to S = \Spec(R)$ factors as $E \to \Spec(H^0(E, \mathcal{O}_E)) \to \Spec(R)$ by Schemes, Lemma \ref{schemes-lemma-morphism-into-affine}. Since by assumption $H^0(E, \mathcal{O}_E)$ is a field we conclude that $E$ maps to a point in $S \subset \mathbf{P}^{n + 1}_S$ which finishes the proof.