Relay driver from microcontroller
Your schematic is missing some very important components that must be in place to produce a stable design. Adding these will go a long way towards fixing the problems with the upsets that happen when the relay clicks in or out.



Add the 1N4001 diode as close across the relay coil as possible. 

Place the 10uF capacitors near where shown.

Place the 0.1uF capacitor as close to the MCU pins as possible. It would actually be good to place a second 0.1uF capacitor at the MCU VIN pin as well.

The problem with the initial click in of the relay is due to the inputs of the ULN2003 going high right as the MCU power goes on before the software gets a chance to get the corresponding port pins programmed as outputs that are driven low. The likely way that this can be fixed is to add a 1K or 1.5K ohm resistor from the input of the ULN2003 to GND. Note that there are some microcontrollers where this solution will not work but since you did not specify your MCU type it is not possible to be fully sure.