It can't be a hit and not be counted in OBP. The official forumula is here:
Baseball Basics: Stats 101 | MLB.com: Official Info
On-Base Percentage (OBP): Divide the total number of hits plus Bases on Balls plus hits by Pitch BY at Bats plus Bases on Balls plus hit by Pitch plus Sacrifice Flies