Here is a sketch for obtaining an analytical solution:
First, we consider only the case $n=1$.
The problem can be written as
$ \min f(p)= (p-z)^2+x |p|$.
Then, by using classical methods and analyzing the cases $p \leq,0$ and $p\geq0$
one can optain that the solution $\bar p$ is given by
$$
\bar p = \tfrac12 \min(z+x,\max(z-x,0)).
$$
I suggest you try to figure out the details by yourself.
For $n>1$, the objective function $f$ can be written as
$$
f(p) = \sum_{i=1}^N \left( (p_i-z_i)^2 + x | p_i| \right).
$$
For this problem the solution can be obtained by minimizing each $p_i$ seperately using the method of the case $n=1$.
This is possible due to the special structure of the problem.
Then the analytical solution can be obtained by putting the individual solutions together in a vector $\bar p\in\mathbb R^n$.