First off, we know very little about your relationship with your boyfriend. For everyone who is saying that there is nothing wrong with you contacting your ex has not asked the right questions.
If you have a perfectly healthy relationship with your BF then I can see where this would be an issue. However, I seriously doubt it. No one is perfect.
Have you had issues with your ex in the past? Have you told your boyfriend that you're not talking to him? Have you fought over him before? Have you lied about talking to him? These are all things we need to know before we give you the benefit of the doubt and dismiss the boyfriend as insecure.