You said in your question that you accepted the offer from A. This is important, because going back and changing your mind is going to annoy them. When you accepted the offer they start to plan around your joining the company, and may have told other candidates for the position that they had been rejected. A change of mind now may make them wonder whether you might change your mind again before you actually start with the company. The best way to do this would not to have accepted the offer until you had received the offer from Company B.
If you really want to try to negotiate a higher salary, first be completely sure which job you would rather have - Company A at the offered salary or Company B. If it's company A, go to them and ask - nicely - if they would consider raising the offer. Be careful not to make it sound like you are rejecting their offer - if you do they would be quite within their rights to withdraw their offer completely. Your chances are not that great. You would have more leverage if you hadn't accepted the job, or if you were prepared to take Company B if A doesn't give you a raise.
On the upside - you have a job you like at a salary you thought acceptable only a couple of days ago. You can always drive yourself crazy thinking about the job you might have had.