I would have the hive about 3 feet (or slightly more) away from away from the barbed wire fence to be safe.
When the hive has lots of supers on the cows might decide to stick their heads over the barbed wire and rub their heads them. This is not really a problem in daylight but more of a possible issue in the dark.
You also need think about being able to work the hive from all round just in case you have problems.