$p^{n-1}$ is a reasonable approximation which is accurate as long as $n \ll p$. The correct value is ${p \choose n-1}=p(p-1)(p-2)\ldots (p-n+2)$. Having chosen the acceptable values for the $x_j$s, each of them has $n-1$ possibilities, so you would have $(n-1)^k$ ways to assign them, which they are probably approximating by $n^k$.
↧