Once you've programmed your pattern in Ultrabeat's step sequencer you don't need to record it again into Logic.
In the bottom left corner of the UltraBeat interface there is the word [i]pattern[i/] and a little box next to it. Drag the box to your Ultrabeat track in the arrange and the pattern you programmed will appear there as a MIDI region.
Remember to press Ultrabeat's power button to deactivate if when you want to playback your project in Logic.
DO Check out Steve H's fantastic tutorial on Ultrabeat: