Ulster ran-in five tries to Cardiff's two as the Irish province racked up a 39-21 RaboDirect Pro12 victory at Ravenhill.