Partial answer:
Lemma: Let $n=am+1$ where $a\ge1$ and $m\ge2$ are integers. Suppose that $m\mid\phi(n)$ and $a<p$ where $p=\min\{p^*\in\Bbb P:p^*\mid m\}$. If $n$ is not prime then either
$n$ is of the form $\prod p_i$ where $p_i$ are primes, or
$n$ is of the form $2^kr$ where $k,r$ are positive integers.
Proof: Suppose that $n$ is composite. First, note that $m$ must be odd as otherwise, $a=1$ which yields $n-1=m$. The condition $m\mid\phi(n)$ forces $n$ to be prime which is a contradiction.
Next, write $n=q^kr$ where $k,r$ are positive integers and $q$ is a prime such that $(q,r)=1$. As $\phi(n)=q^{k-1}(q-1)\phi(r)$ the condition $m\mid\phi(n)$ yields $$q^{k-1}(q-1)\phi(r)=mt\implies aq^{k-1}(q-1)\phi(r)=t(q^kr-1)$$ for some positive integer $t$. It follows that either $k=1$ or $t=q^{k-1}v$ for some integer $v\ne t$. In the latter case, we obtain $$\frac{q^kr-1}{q^{k-1}(q-1)\phi(r)}=\frac{aps}{mt}=\frac at\implies p>\frac{t(q^kr-1)}{q^{k-1}(q-1)\phi(r)}.$$ Combining this with the trivial result $p<q^{k-1}(q-1)\phi(r)/t$ yields $$t<\frac{q^{k-1}(q-1)\phi(r)}{\sqrt{q^kr-1}}\implies v<\frac{(q-1)\phi(r)}{\sqrt{q^kr-1}}.$$ Substituting back into $n=am+1$ gives $$q^kr-1=\frac av(q-1)\phi(r)\implies aq\phi(r)-vq^kr=a\phi(r)-v>\phi(r)\left(a-\frac{q-1}{\sqrt{q^kr-1}}\right)$$ which is positive since $k\ge2$. This yields $a>vq^{k-1}\ge vq$. Since $p$ is the least prime divisor of $m$, we have $p\le q-1$, unless $q=2$ or $q-1=v$.
Evidently, the first case contradicts $a<p$, so $k=1$. This means that $n$ must be of the form $\prod p_i$ where $p_i$ are primes. The condition $m\mid\phi(n)$ gives $\prod(p_i-1)=bm$ for some positive integer $b$, and substituting this into $n=am+1$ yields $$a=b\frac{\prod p_i-1}{\prod(p_i-1)}.$$ When $m$ is even, we have $a<p\implies a<2$ which implies that $m=\prod p_i-1$. Further, $$b<\frac{2\prod(p_i-1)}{\prod p_i-1}<2\implies m=\prod(p_i-1).$$ The only way that $\prod p_i-1=\prod(p_i-1)$ is when $\prod p_i$ is prime, which solves the problem. Finally, notice that $m$ is odd only when $b=2^{\nu_2(\prod(p_i-1))}d$ for some positive integer $d$, so the condition $a<p$ yields $$2^{\nu_2(\prod(p_i-1))}d\frac{\prod p_i-1}{\prod(p_i-1)}<\frac{p_j-1}{2^{\nu_2(p_j-1)}}$$ for some prime $p_j\mid\prod p_i$.
The second case $q=2$ implies that $n=2^kr=am+1$ where $m\mid\phi(r)$; that is, for some positive integer $g$ we have $g(2^kr-1)=a\phi(r)$.
The third case $q-1=v$ forces $m=\phi(r)$, so $m=1$. This is a contradiction as there is no prime $p$ that can divide $m$.
Best Answer
The equation for $n$ is given as
$$n = apq + 1 \tag{1}\label{eq1A}$$
As you've already indicated, if $n$ is prime, then $\varphi(n) = n - 1 = apq$, so $pq \mid \varphi(n)$.
Consider the opposite direction, i.e., $pq \mid \varphi(n)$. With the definition of Euler's totient function, since $\gcd(pq, n) = 1$, this means $pq$ must divide $\prod_{p_i \mid n}(p_i - 1)$, so either $p$ and $q$ divide $2$ different factors, or $pq$ divides just $1$ factor, among the $p_i - 1$ factors, where the $p_i$ are the prime factors of $n$. Thus, there's two cases to consider.
Case #$1$:
Here, $n$ is not a prime, with there being two odd primes $p_{1}$ and $p_{2}$ where
$$p_{1}p_{2} \mid n \implies n = bp_{1}p_{2}, \; b \ge 1 \tag{2}\label{eq2A}$$
$$p \mid p_{1} - 1 \implies p_{1} = cp + 1, \; c \ge 2 \tag{3}\label{eq3A}$$
$$q \mid p_{2} - 1 \implies p_{2} = dq + 1, \; d \ge 2 \tag{4}\label{eq4A}$$
Substituting \eqref{eq3A} and \eqref{eq4A} into \eqref{eq2A}, and equating the result to \eqref{eq1A}, gives
$$\begin{equation}\begin{aligned} b(cp + 1)(dq + 1) & = apq + 1 \\ (bcd)pq + bcp + bdq + b & = apq + 1 \\ bcp + bdq + b - 1 & = (a - bcd)pq \end{aligned}\end{equation}\tag{5}\label{eq5A}$$
The left side is positive, so the right side must be as well. This means
$$a \gt bcd \tag{6}\label{eq6A}$$
From \eqref{eq6A}, plus that $c \ge 2$ from \eqref{eq3A} and $d \ge 2$ from \eqref{eq4A}, we also get $bc \lt \frac{a}{d} \le \frac{a}{2}$, $bd \lt \frac{a}{c} \le \frac{a}{2}$ and $b \lt a$. Using this, along with $p \le q - 2$, in the left side of \eqref{eq5A} gives
$$\begin{equation}\begin{aligned} bcp + bdq + b - 1 & \lt \frac{ap}{2} + \frac{aq}{2} + a \\ & = a\left(\frac{p + q}{2} + 1\right) \\ & \le a\left(\frac{q - 2 + q}{2} + 1\right) \\ & = a\left(q - 1 + 1\right) \\ & = aq \end{aligned}\end{equation}\tag{7}\label{eq7A}$$
However, since the left side of \eqref{eq5A} must be equal to a positive multiple of $pq$, this gives
$$aq \gt pq \implies a \gt p \tag{8}\label{eq8A}$$
which contradicts the requirement of $a \lt p$. Thus, this case is not valid.
Case #$2$:
Here, there is an odd prime $p_{3}$ where
$$p_{3} \mid n \implies n = ep_{3}, \; e \ge 1 \tag{9}\label{eq9A}$$
$$pq \mid p_{3} - 1 \implies p_{3} = fpq + 1, \; f \ge 2 \tag{10}\label{eq10A}$$
Substituting \eqref{eq10A} into \eqref{eq9A}, and equating the result to \eqref{eq1A}, gives
$$\begin{equation}\begin{aligned} e(fpq + 1) & = apq + 1 \\ (ef)pq + e & = apq + 1 \\ e - 1 & = (a - ef)pq \end{aligned}\end{equation}\tag{11}\label{eq11A}$$
Since $pq \mid e - 1$, but $pq \gt a \ge ef$ so $e \lt pq$, then $e = 1$ is the only possibility. This then gives $n = p_{3}$ in \eqref{eq9A}, which means $n$ is a prime.
Only case #$2$ can apply, with it giving that $n$ must be a prime, so this concludes the proof in the opposite direction.