Inform the employer as soon as possible. Ideally you should have never signed the contract, but that is too late for now. However, acknowledging that you made a mistake is responsible behavior, and we all mistakes.
Being an internship, it is unlikely that your job will have a significant impact to the company's business. Companies usually hire interns with a "low-cost labor with lower-than-average quality" attitude, so they don't expect much to begin with. If they expected a professional commitment, they would have offered a full-time package and possibly hired someone experienced.
Can you be held legally responsible? Technically, yes; practically, very unlikely. To sue you, the company must proof that because of your actions, the company has suffered loses and demand you to compensate. However, legal processes takes time and a lot of money; someone sensible would evaluate the cost of letting you go vs the cost of hiring a lawyer to come after you. Unless you were hired for an important or senior position and finding a replacement is costly, they're likely to just let you go.