As Darek said, with open collector (7406) the 10k pull up resistor should be replaced by the relay coil. Make sure the 7406 can sink the current required by the coil (ohms law).
You may also want to look at relay drivers like the DS2003 these have reverse emf diodes installed, are darlington output and can be used to switch 24vdc relays, with 5v input. They come 7 to a chip.
You also need to wire a 1n4005 or similar across the coil, reverse biased, or you may lose the 7406 due to back emf on switch off.
Al.
CNC, Mechatronics Integration and Custom Machine Design
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.