I need to drive a relay, but my logic signal is limited to 3.3v with a maximum of only 2 mA. Can I use a level shifter? I have a 5V relay with a 125 ohm coil drawing approximately 40 mA. Any other recommendations? Should surge suppression diodes be used? (Using National Instruments VirtualBench digital I/O)
Since you only need one channel, something like a ULN2803 is overkill. A single NPN level shifter should work.
But I have to warn you that this is quite possibly marginal. It requires that the transistor be saturated at a gain of about 25, and this is a bit iffy. If the transistor is not quite in saturation, the relay voltage will not be a full 5 volts, and it may not operate reliably. In order to fix this, you might replace the NPN with a small N-type MOSFET with a logic-level gate threshold such as (for instance) a VN0104N3-G. These are available for less than $1.
I had to do this exact thing recently, but in my case I needed to control 8 small relays from 3.3V outputs of a TI chip. So I used a ULN2803, which is an array of 8 darlington transistors, each with built in input resistors and diode protection, to guard against flyback from the relay coils, and each output can drive 500mA. So the 3.3V input can directly feed an input, and the relay coil goes between an output and +5V. If you really only need one, this diagram from the chip data sheet shows how you could make make an individual circuit. But when you consider that some variations of this chip cost only 61¢ at Mouser.com, it almost pays to just get the chip, and leave the other 8 channels for a "future" expansion. ;-)