The Eldritch Knight fighter's War Magic feature (PHB, pg. 75) states:
Beginning at 7th level, when you use your action to cast a cantrip, you can make one weapon attack as a bonus action.
(The 18th-level Improved War Magic feature works the same way, but allows any spell as your action rather than being limited to cantrips.)
The description of Counterspell states:
You attempt to interrupt a creature in the process of casting a spell. If the creature is casting a spell of 3rd level or lower, its spell fails and has no effect. If it is casting a spell of 4th level or higher, make an ability check using your spellcasting ability. The DC equals 10 + the spell's level. On a success, the creature's spell fails and has no effect.
For example, say my Eldritch Knight attempts to cast booming blade. If someone casts counterspell on my booming blade, am I still able to make the bonus-action weapon attack?