I am a nurse and I give tons of IM shots! It could have been in a vein although it is pretty rare, it could happen. Make sure you pull back on the plunger a little bit before you inject the medicine to make sure that no blood comes into the syringe. If it does, then you are in a vein.
What is more likely is that you injected at a slightly odd angle. That can cause bleeding and bruising at the injection site. Good luck with everything!