Photocured electrolytes for lithium batteries