Yes, the bonus action from a Haste spell can be used to cast a second spell as long as the spell requires an attack roll.
The rules are quite clear that any spell that requires an attack roll is classed as an attack and is covered as an attack action.
The second paragraph of the description of the Attack Action states (PHB, page 192):
With this action, you make one melee or ranged attack. See “Making an Attack” section for the rules that govern an attack.
The first paragraph of the “Making an Attack” section states (PHB, page 194; this is just the fluff, BTW):
Whether you’re striking with a melee weapon, firing a weapon at range, or making an attack roll as part of a spell, an attack has a simple structure.
The last paragraph in this section is the clincher:
If there’s ever any question whether something you’re doing counts as an attack, the rule is simple: If you’re making an attack roll, you’re making an attack.
I don’t think it could be any clearer.