Unprotected penetration between two partners of unknown health status does carry a risk, whether or not ejaculation is involved.
However, having said that, a single, isolated act of unprotected sex does not put us at a significant risk of HIV due to the fact that status of the partner is unknown and strong possibility is, he / she may not be an infected person.
So your risk is there, but not significant. Suggest you to relax and wait 28 days, counted from the day of the exposure, get yourself tested for HIV Duo 4th generation test, collect your conclusive report and move on with your life normally.
Next time, never ever unprotected penetration outside your mutually committed monogamous relationship. The best friend of a girl is not her boy friend, but her condom