The signs may or may not be linked. I am assuming that because you got confirmation of an E. coli infection, that a urine culture was performed. Otherwise it is extremely difficult to put a name on a bacteria. E.Coli is a common rod shaped bacteria found in urine, and is more common in younger pets.
Any drug can cause a reaction in any pet or person. Therefore, yes it is POSSIBLE that the cipro is causing a side effect. A common side effect is nausea, vomiting, and listlessness. These signs often go away when the drug usage is stopped.
This drug belongs to the flouroquinolone family of drugs and this category of drug (but not all types of these drugs) are clinically documented to cause joint cartelage or defects later in life, when given to young growing puppies. This usually occurs in medium to large breed dogs and may not show up until they are older. I agree that your concerns are justified, and you may want to consider switching antibiotics.
The pain in the prepuce may be what is called a balanoposthitis (prepuce infection) and may be due to the bacterial contamination. I would suggest re-evaluating the pet by your regular veterinarian, or another one for a second opinion as he may need further medication or a change in medications.
The swelling, If it is on the penis itself, inside of the prepuce, is likely to be the glans of the penis, and is the canine equivalent of an erection. If it is outside of the penis, then you may have an ascending infection and I suggest seeking further medical care.
Your pet may also need anti-inflammatory/pain medications for the pain and swelling as well.
Please feel free to ask further questions if needed.