You need to check this out with Rockstar or wait for someone who knows the answer because he already tried.
I do not own the game, but I think it depends on how it handles netplay and copyright stuff. If Steam and Rockstar have two different DRM policies and two different game servers for their respective versions, then you most likely won't be able to play with your friends.
On the other hand, as it's something that has been seen with the majority of games on Steam by now, some retail games will ask you to either register a Steam account and bind the copy's key to it and/or launch with an external launcher (e.g. Ubisoft games using Uplay but sold on Steam will launch Uplay instead of the game itself, and will require you to log in and associate the game copy to an Uplay account as well); should any of these be the case, you would be actually able to play with your friends (in theory).
I repeat tho, this is just my opinion on the matter, I'm not 100% sure of this. Before you go on buying, I suggest waiting for someone else who knows the correct answer, or if you can't wait get a copy from the same place your friends got theirs.