You need to tell him. He'll find out eventually anyway & it will only make it worse later. The sooner you tell him the better. Make sure you talk about all of the reasons why it happened. He may need to learn to trust you again, but that's just a consequence you'll have to take. Sorry if it's not what you want to hear.