How can I populate a user field via a plugin?
Relational fields are always stored as arrays, even if you are limiting them to only one entry so this should work:

$entry-&gt;setContentFromPost(['userAccount' =&gt; array($user-&gt;id)]);